<html>
    <head>
        <meta charset="UTF-8">
        <link rel="stylesheet" href="https://cdn.staticfile.org/layui/2.6.8/css/layui.min.css" />
        <script src="https://cdn.staticfile.org/layui/2.6.8/layui.min.js" ></script>
        <script src="../../res/js/mz.form.js"></script>
        <script src="../../res/js/mz.common.js"></script>
        <style>
            .layui-form-pane .layui-form-label{width: 200px;}
            .layui-form-pane .layui-input-block{margin-left: 200px;}
        </style>
    </head>
    <body>

        <div style=" margin: 10px auto;">
            <div style="margin: 30px;">
                项目编号：
                <input id="xmNo"  class="layui-input" placeholder="输入项目编号" style="display: inline-block; width: 20%;"  />
                <button id="query" class="layui-btn">查找</button>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                <a href="edit.html" target="_blank">切换数据源</a>
            </div>
            <form id="data_form" lay-filter="data_form" class="layui-form layui-form-pane">

            </form>
        </div>


        <script>

            var field_setting = [
                {title: 'id', name: 'id', type: 'hidden', value: 1},
                {title: 'uuid', name: 'UUID', type: 'hidden'},
                {title: '报名开始时间', name: 'SIGNUP_START', type: 'text'},
                {title: '报名结束时间', name: 'SIGNUP_END', type: 'text'},
                {title: '投标截止时间', name: 'TBJZSJ', type: 'text'}
            ];

            field_setting.push({type: 'buttons', name: 'submit'});

            var mzForm = new MZForm({
                id: 'data_form',
                elements: field_setting,
                submit:{
                    post_url: base_url + '/update_project_time',
                    success_url: '../index.html'
                }
            });

            layui.$("#query").click(function () {
                layui.$.get(base_url + '/project_get', {apply_no: layui.$("#xmNo").val()}, function (data) {
                    if(data.content && data.content.length){
                        layui.form.val('data_form', data.content[0])
                    }else{
                        layer.msg("项目不存在");
                    }
                })
            });


        </script>

    </body>
</html>
